package com.mh.rpc.consumer.controller;

import com.mh.rpc.api.pojo.User;
import com.mh.rpc.api.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user")
public class UserController {

    private final IUserService userService;

    @Autowired
    public UserController(IUserService userService) {
        this.userService = userService;
    }

    @GetMapping("/get/{id}")
    public User getUser(@PathVariable Integer id){
        return userService.getById(id);
    }

}
